<template>
  <div class="about">
    <H1>你好{{ $store.state.userName }}</H1>
    <button @click="setUserName">更新全局姓名</button>
    <h1>This is an about page</h1>
  </div>
</template>

<script>
// @ is an alias to /src

export default {
  name: "AboutView",
  components: {},
  methods: {
    setUserName() {
      this.$store.dispatch("setUserName", "新名称" + new Date() * 1);
    },
  },
};
</script>
